<template>
  <div class="pdf">
    <div class="pdf-head">
      <div class="pdf-head-left">
        <slot name="pdf-head-left"></slot>
      </div>
      <div class="pdf-head-right">
        <slot name="pdf-head-right">
            <span @click="detailBody = !detailBody">{{detailBody?'展开':"收起"}}</span>
        </slot>
      </div>
    </div>
    <div class="pdf-body" :style="{'height':detailBody?'0':'200px'}">
        <div>
            <slot name="pdf-body"></slot>
        </div>

    </div>
    <div class="pdf-foot"></div>
  </div>
</template>

<script>
export default {
    data(){
        return {
            detailBody:false
        }
    }
};
</script>

<style lang="less" scoped>
.pdf {
  background-color: rgba(255, 255, 255, 0.6);
  width: 90%;
  margin: 0px auto 30px;
  box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.2);
  .pdf-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    border-bottom: 1px solid rgba(30, 30, 30, 0.1);
    padding: 0 30px;
    .pdf-head-left{
        font-weight: 300;
        font-size: 20px;
        color: rgba(20, 20, 20, 0.7);
    }
    .pdf-head-right{
      &:hover{
        cursor: pointer;
      }
        font-weight: 400;
        font-size: 13px;
        color: rgba(100, 100, 100, 0.5);
    }
  }
  .pdf-body {
    height: 100px;
    overflow: auto;
    max-height: 200px;
    border-bottom: 1px solid rgba(30, 30, 30, 0.1);
    transition: all 0.3s;
    div{
        margin: 10px 8px;
    }
  }
  .pdf-foot {
    height: 30px;
  }
}
</style>